package day02;

public class ObserverPatternDemo {

    public static void main(String[] args) {
        // 要订阅的对象
        Subject subject = new Subject();
        // 订阅同一个对象
        new HexaObserver(subject);
        new OctalObserver(subject);
        new BinaryObserver(subject);

        // 对象发生变换
        System.out.println("First state change: 15");
        subject.setState(15);
        System.out.println("Second state change: 10");
        subject.setState(10);

    }

}
